profiling: Only use frame timings when we have them
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 May 2019 19:49:25 +0000 (15:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 May 2019 12:06:55 +0000 (12:06 +0000)
Christian Hergert reported a crash here,
when testing the profiling code.

gdk/gdkframeclockidle.c

index ae6443a798e0471a484d3d3ff6d6118457d982e3..8bbdffb68b7ec4105791d143bc4b20d268e3909f 100644 (file)
@@ -573,8 +573,11 @@ gdk_frame_clock_paint_idle (void *data)
 #ifdef G_ENABLE_DEBUG
   if (gdk_profiler_is_running ())
     {
-      add_timings_to_profiler (timings);
-      gdk_profiler_set_counter (fps_counter, timings->frame_end_time * 1000, frame_clock_get_fps (clock)); 
+      if (timings)
+        {
+          add_timings_to_profiler (timings);
+          gdk_profiler_set_counter (fps_counter, timings->frame_end_time * 1000, frame_clock_get_fps (clock)); 
+        }
     }
 
   if (GDK_DEBUG_CHECK (FRAMES))